import request from '@/utils/request'

// 1.加入购物车
export const addCart = (goodsId, goodsNum, goodsSkuId) => {
  return request.post('/cart/add', {
    goodsId, goodsNum, goodsSkuId
  })
}

// 2.获取购物车数据
export const getCartList = () => {
  return request.get('/cart/list')
}

// 3.更新购物车商品数量
export const changeCount = (goodsNum, goodsId, goodsSkuId) => {
  return request.post('/cart/update', {
    goodsId,
    goodsNum,
    goodsSkuId
  })
}

// 4.删除购物车数据
export const delSelect = (cartIds) => {
  return request.post('/cart/clear', {
    cartIds
  })
}
